#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time   : 2023-09-17 15:35
# @Author : hard work
# @File    : l3_traffic_util.py
# @Description :
from stc_utils.py_util.l2_traffic_util import Create_l2_traffic


class Create_l3_traffic(Create_l2_traffic):

    def __init__(self, stcInstallDir, stc_Chassis_addr, slot, port_TX, port_RX, port_RX_OB,port_RX_20,port_RX_16):
        super().__init__(stcInstallDir, stc_Chassis_addr, slot, port_TX, port_RX, port_RX_OB,port_RX_20,port_RX_16)
        self.hip1 = None
        self.rxIpAddr = None
        self.txIpAddr = None

    def create_ipv4_flow(self, dicts):
        if dicts is None:
            self.txIpAddr = "192.168.10.1"
            self.rxIpAddr = "10.1.2.3"
        else:
            self.txIpAddr = dicts['txIpAddr']
            self.rxIpAddr = dicts['rxIpAddr']
        self.hip1 = self.stc.create("ipv4:IPv4", under=self.hStreamBlock, name="sb1_ip", sourceAddr=self.txIpAddr,
                               gateway=self.rxIpAddr, destAddr=self.rxIpAddr)

    def create_ipv6_flow(self):
        """不想写，哈哈"""
        pass